package controller;

import java.lang.annotation.Annotation;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import pojo.Customer;
import service.CustomerManager;
import service.factory.CustomerManagerFactory;

@Controller
public class CustomerController{
	private CustomerManager manager = CustomerManagerFactory.getInstance();
	
	@RequestMapping(value="/addform")
	public String test9(Customer c){
		manager.add(c);
		return "redirect:/listform";
	}
	
	@RequestMapping(value="/listform")
	public String test10(Model model){
		model.addAttribute("customerlist", manager.getlist());
		return "showform";
	}


}
